package com.itheima.date8;

import java.time.LocalDateTime;

public class Demo08 {

    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        System.out.println(now.withYear(2050));
        System.out.println(now.withMonth(12));
       // System.out.println(now.withMonth(13));
        System.out.println(now.withDayOfMonth(31));
        //System.out.println(now.plusMonths(1).withDayOfMonth(31));
        System.out.println(now.minusMonths(6).withDayOfMonth(28));
        System.out.println(now.withDayOfYear(365));
        System.out.println(now.minusYears(1).withDayOfYear(366));

    }
}
